import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      redirect: "/login"
    },
    {
      path: '/home',
      name: 'home',
      redirect: '/home/settings',
      component: HomeView,
      children:  [
        {
          path: "/home/settings",
          name: 'settings',
          component: () => import('../views/SettingsView.vue'),
          meta: {
            title: "管理主页"
          }
        },
        {
          path: "/home/user",
          name: 'user',
          component: () => import('../views/UserView.vue'),
          meta: {
            title: "用户管理"
          }
        },
        {
          path: "/home/jiangchi",
          name: 'jiangchi',
          component: () => import('../views/JiangchiView.vue'),
          meta: {
            title: "奖池管理"
          }
        },
        {
          path: "/home/zhubo",
          name: 'zhubo',
          component: () => import('../views/ZhuboView.vue'),
          meta: {
            title: "主播管理"
          }
        },
        {
          path: "/home/zhibo",
          name: 'zhibo',
          component: () => import('../views/ZhiboView.vue'),
          meta: {
            title: "直播管理"
          }
        },
        {
          path: "/home/shipin",
          name: 'shipin',
          component: () => import('../views/ShipinView.vue'),
          meta: {
            title: "视频管理"
          }
        },
        {
          path: "/home/caiwu",
          name: 'caiwu',
          component: () => import('../views/CaiwuView.vue'),
          meta: {
            title: "财务管理"
          }
        },
        {
          path: "/home/jiazu",
          name: 'jiazu',
          component: () => import('../views/JiazuView.vue'),
          meta: {
            title: "家族管理"
          }
        },
        {
          path: "/home/daoju",
          name: 'daoju',
          component: () => import('../views/DaojuView.vue'),
          meta: {
            title: "道具管理"
          }
        },
        {
          path: "/home/hongbao",
          name: 'hongbao',
          component: () => import('../views/HongbaoView.vue'),
          meta: {
            title: "红包管理"
          }
        },
        {
          path: "/home/shouhu",
          name: 'shouhu',
          component: () => import('../views/ShouhuView.vue'),
          meta: {
            title: "守护管理"
          }
        },
        {
          path: "/home/dengji",
          name: 'dengji',
          component: () => import('../views/DengjiView.vue'),
          meta: {
            title: "等级管理"
          }
        },
        {
          path: "/home/yaoqing",
          name: 'yaoqing',
          component: () => import('../views/YaoqingView.vue'),
          meta: {
            title: "邀请码管理"
          }
        },
        {
          path: "/home/dazhuanpan",
          name: 'dazhuanpan',
          component: () => import('../views/DazhuanpanView.vue'),
          meta: {
            title: "大转盘"
          }
        },
        {
          path: "/home/denglujiangli",
          name: 'denglujiangli',
          component: () => import('../views/DenglujiangliView.vue'),
          meta: {
            title: "登录奖励"
          }
        },
        {
          path: "/home/xiaoxi",
          name: 'xiaoxi',
          component: () => import('../views/XiaoxiView.vue'),

          meta: {
            title: "消息管理"
          }
        },
        {
          path: "/home/neirong",
          name: 'neirong',
          component: () => import('../views/NeirongView.vue'),
          meta: {
            title: "内容管理"
          }
        },
        {
          path: "/home/chajian",
          name: 'chajian',
          component: () => import('../views/ChajianView.vue'),
          meta: {
            title: "插件管理"
          }
        },
        {
          path: "/home/gouwu",
          name: 'gouwu',
          component: () => import('../views/GouwushangchengView.vue'),
          meta: {
            title: "购物管理"
          }
        },
        {
          path: "/home/quanzi",
          name: 'quanzi',
          component: () => import('../views/QuanziView.vue'),
          meta: {
            title: "圈子管理"
          }
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/LoginView.vue'),
      meta: {
        title: "管理员登录"
      }
    }
  ]
})

export default router
